package matchthreegame.serverEvents;


import matchthreegame.extensions.MatchThreeGameZoneExtension;

import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.core.SFSEventParam;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;

public class OnUserJoinZoneHandler extends BaseServerEventHandler {

	@Override
	public void handleServerEvent(ISFSEvent event) throws SFSException {
		
		MatchThreeGameZoneExtension zoneExtension = (MatchThreeGameZoneExtension)getParentExtension();
		User userJoinedInZone = (User)event.getParameter(SFSEventParam.USER);
		
		zoneExtension.joinUserToLobby(userJoinedInZone);
		trace("User: " + userJoinedInZone.getId() + " joined zone" );
		
	}

}
